<div id="addnew_tour_day"></div>
<div id="tour_days_table">
  <table>
    <tr>
      <td> 
        <%= link_to 'back', tours_path, class: " btn btn-inverse", remote: true %>    
      </td>
      <td>
        <%= link_to 'new', new_tour_day_path({tid: params[:tid]}), class: " btn btn-primary", remote: true %>    
      </td>
    </tr>
  </table>
  <table class="table">
    <thead>
      <tr>
        <th><%= "day" %></th>
        <th>Description</th>
        <th>Images</th>
        <th style="text-align:center;" colspan="2">Action</th>
      </tr>
    </thead>

    <tbody id="tour_days">
      <% @tour_days.each do |tour_day| %>
        <tr>
          <td><%= tour_day.day_number %></td>
          <td><%= raw(tour_day.description_eng) %></td>
          <td><%= link_to "images", tour_day_images_path({tdid: tour_day.id, tid: params[:tid]}), remote: true %></td>
          <td class="text-center">
            <%= link_to 'Edit', edit_tour_day_path(tour_day, {tid: params[:tid]}), remote: true %> | 
            <%= link_to 'Delete', {controller: 'tour_days', action: 'destroy' , id: tour_day.id , tid: params[:tid] }, method: :delete, remote: true, data: { confirm: 'Are you sure?' } %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>


  <div class="collection_paginator">
    <%#= will_paginate tour_days %>
  </div>

</div>